package com.cheapflix.beans;

import java.io.Serializable;

/**
 * @author Group B.
 * Bean class that holds all information 
 * pertaining to a DVD.
 */
public class DVD implements Serializable {

    private String image;
    private int id;
    private String actors;
    private String genre;
    private String title;
    private String director;
    private String year;
    private String runtime;

    //constructor
    public DVD() {
    }

    /**
     * Equals method basically just checks primary key
     * @param obj
     * @return 
     */
    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final DVD other = (DVD) obj;
        if (this.id != other.id) {
            return false;
        }
        return true;
    }

    /**
     * Hashcode, only uses primary key
     */
    @Override
    public int hashCode() {
        int hash = 7;
        hash = 31 * hash + this.id;
        return hash;
    }

    //Getters and setters
    public String getActors() {
        return actors;
    }

    public void setActors(String actors) {
        this.actors = actors;
    }

    public String getGenre() {
        return genre;
    }

    public void setGenre(String genre) {
        this.genre = genre;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDirector() {
        return director;
    }

    public void setDirector(String director) {
        this.director = director;
    }

    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    public String getRuntime() {
        return runtime;
    }

    public void setRuntime(String runtime) {
        this.runtime = runtime;
    }
}
